
import { _decorator, Component, Node, ProgressBar, Label } from 'cc';
import { CustomEventListener } from '../data/CustomEventListener';
import { E2LProtocol } from '../proto/ELProtocol';
import { Utils } from '../utils/utils';
const { ccclass, property } = _decorator;
 
@ccclass('LoginLoad')
export class LoginLoad extends Component {
    // [1]
    // dummy = '';

    @property({
        type: ProgressBar
    })
    progressBar: ProgressBar = null;

    @property({
        type: Label
    })
    info: Label = null;

    start () {
        this.progressBar.progress = 0;
        this.info.string = "加载中";

        // 获得token和gameid等全局参数
        Utils.GetTokenAndGameID();
        // 开启登录流程
        CustomEventListener.dispatchEvent(E2LProtocol.e2l_start_login);
    }

}

